<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
      layout:decorate="~{layout/default}">
<head>
    <title>销售机会详情</title>
</head>
<body>
    <div layout:fragment="content">
        <div class="d-flex justify-content-between align-items-center mb-3">
            <h1>销售机会详情</h1>
            <div>
                <a th:href="@{/opportunity/edit/{id}(id=${opportunity.id})}" class="btn btn-primary">编辑</a>
                <a th:href="@{/opportunity/list}" class="btn btn-secondary ml-2">返回列表</a>
            </div>
        </div>
        
        <div class="card">
            <div class="card-body">
                <div class="row">
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>机会名称</label>
                            <p class="form-control-static" th:text="${opportunity.name}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>所属客户</label>
                            <p class="form-control-static" th:text="${opportunity.customerName}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>联系人</label>
                            <p class="form-control-static" th:text="${opportunity.contactName}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>销售阶段</label>
                            <p class="form-control-static">
                                <span th:class="${'badge ' + (opportunity.stage == 5 ? 'badge-success' : (opportunity.stage == 6 ? 'badge-danger' : 'badge-info'))}" 
                                      th:text="${opportunity.stageName}">-</span>
                            </p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>预期金额</label>
                            <p class="form-control-static" th:text="${'¥' + opportunity.expectedAmount}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>预计成交日期</label>
                            <p class="form-control-static" th:text="${opportunity.expectedDate}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>负责人</label>
                            <p class="form-control-static" th:text="${opportunity.managerName}">-</p>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <div class="form-group">
                            <label>创建时间</label>
                            <p class="form-control-static" th:text="${opportunity.createTime}">-</p>
                        </div>
                    </div>
                    <div class="col-md-12">
                        <div class="form-group">
                            <label>备注</label>
                            <p class="form-control-static" th:text="${opportunity.remark}">-</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html> 